{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "31fd14d8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0. , 0.5])"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "x = np.array([0, 1]) # 输入\n",
    "w = np.array([0.5, 0.5]) # 权重\n",
    "b = -0.7 # 偏置\n",
    "w*x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "fc551258",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "np.float64(0.5)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(w*x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "1f291e1a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "np.float64(-0.19999999999999996)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(w*x)+b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "420e412c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-1.,  1.,  2.])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = np.array([-1.0, 1.0, 2.0])\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "6d83aef7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 1])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = x > 0\n",
    "y = y.astype(int)\n",
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "e2e49445",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAG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ai8rJ1NaWojBSXgna3/zL24Jh4+Ht3+/cFds1xIw6MAf1aqh4GkHIYGTx4cLS0tMTq1at7PV9sDx06dJv7FM/X8/rCgAEDyseedtaEQ/b4zwAAdqyuemj//v1j7NixsXjx4p7nigbWYnvixInb3Kd4fuvXFx5++OHtvh4AyEvdl2mKyyfTpk2LcePGxfjx42PevHnlbJnp06eXfz916tQYPnx42fdRuPjii+Okk06K66+/Pk477bS455574sknn4xbb7119/82AEDjh5Fiqu7atWtj9uzZZRNqMUV30aJFPU2qK1asKGfYdDv++OPj7rvvjq997Wtx+eWXxxFHHFHOpBk1atTu/U0AgDzWGamCdUYAoO/Z2c9vc+gAgEoJIwBApYQRAKBSwggAUClhBAColDACAFRKGAEAKiWMAACVEkYAgEoJIwBApYQRAKBSwggAUClhBAColDACAFRKGAEAKiWMAACVEkYAgEoJIwBApYQRAKBSwggAUClhBAColDACAFRKGAEAKtUv+oDOzs7ya3t7e9VDAQB2UvfndvfneJ8OIxs2bCi/trW1VT0UAGAXPscHDRq03b9v6ny7uJKAjo6OePXVV2P//fePpqamyF2RNItgtnLlymhtba16OA3Ne733eK/3Hu/13pP7e93Z2VkGkWHDhkVzc3PfrowUv8DBBx9c9TCSU/zDzvEfdxW813uP93rv8V7vPTm/14N2UBHppoEVAKiUMAIAVEoY6YMGDBgQc+bMKb+yZ3mv9x7v9d7jvd57vNc7p080sAIAjUtlBAColDACAFRKGAEAKiWMAACVEkYaxKZNm2LMmDHlCrVPP/101cNpOC+//HKcc845ceihh8Y+++wThx9+eNkhv3nz5qqH1hDmz58fI0aMiIEDB8aECRNi6dKlVQ+pIc2dOzeOO+64cjXrgw46KM4444x44YUXqh5Ww7v22mvLc/NXvvKVqoeSLGGkQVx66aXlcrvsGc8//3x5W4Lvfe978eyzz8aNN94YCxYsiMsvv7zqofV5CxcujBkzZpThbvny5TF69OiYPHlyrFmzpuqhNZxHH300Lrjggvjtb38bDz/8cLzxxhtx6qmnxsaNG6seWsP63e9+V543jjnmmKq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ABQKWEEAKiUMAIARJX+P2Gkk5UUAqqdAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# -------阶跃函数---------\n",
    "import numpy as np\n",
    "import matplotlib.pylab as plt\n",
    "\n",
    "def step_function(x):\n",
    "    return np.array(x > 0, dtype=int)\n",
    "\n",
    "x = np.arange(-5.0, 5.0, 0.1)\n",
    "y = step_function(x)\n",
    "plt.plot(x, y)\n",
    "plt.ylim(-0.1, 1.1) # 指定y轴的范围\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "19b476e9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.26894142, 0.73105858, 0.88079708])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def sigmoid(x):\n",
    "    return 1 / (1 + np.exp(-x))\n",
    "\n",
    "x = np.array([-1.0, 1.0, 2.0])\n",
    "sigmoid(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "90a2540e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2., 3., 4.])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t = np.array([1.0, 2.0, 3.0])\n",
    "1.0 + t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "b85710b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1.        , 0.5       , 0.33333333])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1.0 / t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "97aa1a25",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMp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7nJvwcAADg5t7yHuzXyYg3pHN2ys7PtLgkAALjDyEhcXJwCAgKUm5tb57x1nJiYeNzXWOcb8nxLSEiI2QAAgPdr0MhIcHCwBgwYoCVLltSesxpYreNhw4Yd9zXW+WOfb1m8ePEJnw8AAHxLg6f2Ws2oY8eO1cCBA83aItbUXmu2zLhx48zXx4wZo7Zt25q+D8v48eN1zjnn6Mknn9Rll12mefPmadWqVXrxxRcb/6cBAADeH0asqbr5+fmaOnWqaUK1puguWrSotkk1KyvLzLA56vTTTzdri9x3332aPHmyWfTMmklj9xojAADAQ9cZsUNTrTMCAADs//x2y9k0AADAdxBGAACArQgjAADAVoQRAABgK8IIAACwFWEEAADYijACAABsRRgBAAC2IowAAABbEUYAAICtCCMAAMBWhBEAAGArwggAALAVYQQAANiKMAIAAGxFGAEAALYijAAAAFsRRgAAgK0IIwAAwFaEEQAAYCvCCAAAsBVhBAAA2IowAgAAbBUoD+ByucxjcXGx3aUAAIB6Ovq5ffRz3KPDSElJiXlMSUmxuxQAAHAKn+MxMTEn/Lqf6+fiihtwOp3au3evoqKi5OfnJ19nJU0rmGVnZys6Otrucrwav+vmw++6+fC7bj6+/rt2uVwmiCQlJcnf39+zR0asHyA5OdnuMtyO9RfbF/9y24HfdfPhd918+F03H1/+XcecZETkKBpYAQCArQgjAADAVoQRDxQSEqJp06aZRzQtftfNh9918+F33Xz4XdePRzSwAgAA78XICAAAsBVhBAAA2IowAgAAbEUYAQAAtiKMeInKykr169fPrFC7bt06u8vxOrt27dLNN9+sDh06KCwsTJ06dTId8lVVVXaX5hVmzZql1NRUhYaGasiQIVq5cqXdJXmlGTNmaNCgQWY16/j4eI0aNUpbt261uyyv9+ijj5r35rvuusvuUtwWYcRL3HPPPWa5XTSN9PR0c1uCv//979q0aZOefvppzZ49W5MnT7a7NI83f/58TZgwwYS7NWvWKC0tTSNGjFBeXp7dpXmdL774QnfccYe++eYbLV68WNXV1broootUVlZmd2le67vvvjPvG3379rW7FPdmTe2FZ1u4cKGre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AABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.arange(-5.0, 5.0, 0.1)\n",
    "y = sigmoid(x)\n",
    "plt.plot(x, y)\n",
    "plt.ylim(-0.1, 1.1)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "e17f583f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[19, 22],\n",
       "       [43, 50]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# ----ReLU函数----\n",
    "def ReLU(x):\n",
    "    return np.maximum(0, x)\n",
    "\n",
    "A = np.array([[1,2], [3,4]])\n",
    "B = np.array([[5,6], [7,8]])\n",
    "np.dot(A, B)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "c9c77530",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[22, 28],\n",
       "       [49, 64]])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = np.array([[1,2,3], [4,5,6,]])\n",
    "B = np.array([[1,2],[3,4], [5,6]])\n",
    "np.dot(A, B)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7516ff61",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 5 11 17]\n"
     ]
    }
   ],
   "source": [
    "X= np.array([1,2]) # 注意有几个方括号\n",
    "W = np.array([[1,3,5], [2,4,6]])\n",
    "Y = np.dot(X, W)\n",
    "print(Y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "51bc9dbf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.3 0.7 1.1]\n"
     ]
    }
   ],
   "source": [
    "X = np.array([1.0, 0.5])\n",
    "W1 = np.array([[0.1, 0.3, 0.5], \n",
    "               [0.2, 0.4, 0.6]])\n",
    "B1 = np.array([0.1, 0.2, 0.3])\n",
    "\n",
    "A1 = np.dot(X, W1) + B1\n",
    "print(A1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "db1d46fa",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.3 0.7 1.1] [0.57444252 0.66818777 0.75026011]\n"
     ]
    }
   ],
   "source": [
    "Z1 = sigmoid(A1)\n",
    "print(A1, Z1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "e099dc37",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(3,) (3, 2) (2,)\n",
      "[0.51615984 1.21402696] [0.62624937 0.7710107 ]\n"
     ]
    }
   ],
   "source": [
    "W2 = np.array([[0.1, 0.4], [0.2, 0.5], [0.3, 0.6]])\n",
    "B2 = np.array([0.1, 0.2])\n",
    "\n",
    "print(Z1.shape, W2.shape, B2.shape)\n",
    "\n",
    "A2 = np.dot(Z1, W2) + B2\n",
    "Z2 = sigmoid(A2)\n",
    "\n",
    "print(A2, Z2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0c171b20",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
